<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Arr extends Array {
            constructor(...args) {
                super(...args);
            }
            first() {
                return this[0];
            }
            max() {
                // return this.sort((a, b) => b - a)[0]
                return Math.max(...this);
            }
            min(){
                return Math.min(...this);
            }
            filterArr(){
               return [...new Set(this)];
            }
            add(item){
                this.push(item);
            }
        }
        
        let zh = new Arr(2, 58, 5,5,5,5,5, 8, 1,1, 2, 53, 456, 4, 54, 15, 4);
        zh.add(1000);
        console.log('原始数据',zh);
        console.log('第一个元素：',zh.first());
        console.log('最大值：',zh.max());
        console.log('最小值：',zh.min());
        console.log('去重：',zh.filterArr());
    </script>
</body>

</html>